package cn.gcxy.jdbc;

import java.sql.SQLException;
import java.util.List;

import cn.gcxy.common.db.ConnectionHandler;

public class JdbcTestDemo {
	public static void main(String[] args) {
		UserDAO dao=new UserDAO();
		try {
			UserInfo  u=new UserInfo();
			u.setUserno(14);
			u.setUsername("ttt1");
			u.setAge(20);
			dao.insertUser(u);
			
			List<UserInfo> users=dao.findUsersByName("t");
			for(UserInfo user:users){
				System.out.println(user);
			}
			

		} catch (SQLException e) {
			e.printStackTrace();
		}finally{
			ConnectionHandler.closeConnection();
		}

	}
}
